import VueRouter from 'vue-router'

import home from './component/tabbar/Home.vue'
import vip from './component/tabbar/vip.vue'
import shopcar from './component/tabbar/Shopcar.vue'
import search from './component/tabbar/Search.vue'
import news from './component/news/news.vue'
import newsInfo from './component/news/newsinfo.vue'
import photos from './component/photos/photoList.vue'
import photoInfo from './component/photos/photoInfo.vue'
import goodList from './component/goods/goodsList.vue'
import goodsInfo from './component/goods/goodsInfo.vue'
import GoodsDesc from './component/goods/GoodsDesc.vue'
import GoodsComment from './component/goods/GoodsComment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  // mode:'history',
  routes: [
    {path:'/',redirect:'/home'},
    {path:'/home',component:home},
    {path:'/vip',component:vip},
    {path:'/shopcar',component:shopcar},
    {path:'/search',component:search},
    {path:'/news',component:news},
    {path:'/newsinfo/:id',component:newsInfo},
    {path:'/photos',component:photos},
    {path:'/photoInfo/:id',component:photoInfo},
    {path:'/goodList',component:goodList},
    {path:'/goodsinfo/:id',component:goodsInfo},
    
    {path:'/GoodsDesc/:id',component:GoodsDesc,name:'goodsdesc'},
    {path:'/GoodsComment/:id',component:GoodsComment,name:'goodscomment'},
  ],
  linkActiveClass: 'mui-active' // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})

// 把路由对象暴露出去
export default router
